feat(permission): add harness-owned worker grant envelope - #1222
Open
TheGreatAxios wants to merge 7 commits into
Open
TheGreatAxios wants to merge 7 commits into
TheGreatAxios wants to merge 7 commits into
Conversation
A worker deny-on-ask registers a denied-call envelope keyed by worker session with single-parent-turn expiry. The deny reason names only the envelope requestId and the parent retries via resume_agent with exact args.
Ask names its denial via grant_request_id; unnamed keeps first-pending. Expiry yields a fresh gate round that mints a fresh envelope. Precheck-to-consume serializes per fingerprint.
origin/main relocated shared test helpers from tests/helpers to testkit; the grant threading test follows the mock-module import.
Two denies of the same exact call under fresh call ids name the same grant request instead of prompting the parent twice.
TheGreatAxios
force-pushed
the
cl-9475-worker-grant
branch
from
September 29, 2026 18:22
a4fcce5 to
0f69c3c
Compare
Authorize leaves the envelope pending so the granted retry survives the execution backstop, which now spends it exactly once; precheck no longer vetoes sibling sessions, and unwired helpers are removed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
grant_request_id, and the parent replays the exact call through its own gate operator path before retrying via the existingresume_agentVerification
bun run checkpasses: lint, typecheck, dead-export guard, build, and the guarded test suite (7587 pass, 0 fail across 513 files)grant_request_idthreading, production two-stage authorize-then-execute keeper, per-session envelope keeper (pending and consumed variants), non-matching-id fallbackReview follow-ups
authorizeWorkerCallInnerno longer consumes on allow;executionVerdictWorkerCallInneris the sole spend point, so the granted retry survives authorize then executes once, and a second execution denies as already consumedbuildRetryMessage,byQuestion,decline/declineAllForSession(+ thedeclinedstatus),auditTrail, and theonDeniedCallhook; audit history remains readable on the envelope itselfregisterAskpasses the session-store clock intoattachToAsk, so grant timestamps respect fake timersFixes CL-9475